/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Portions created by the Initial Developer are
 * Copyright (C) 2012 the Initial Developer.
 * All Rights Reserved.
 *
 * The Original Code is this.
 *
 * The Initial Developer of the Original Code is the author below.
 */
/**
 * @file DataSourceConfig.h
 * @brief auto generated.
 * @author K.Ozaki
 * @date 2011/07/21
 */

#ifndef DATASOURCECONFIG_H_
#define DATASOURCECONFIG_H_

#include "semi/posix/SharedMemory.h"

namespace semi {
namespace conf {

/*
 * DataSourceConfig
 *
 */
class DataSourceConfig {
public:
    DataSourceConfig();
    virtual ~DataSourceConfig();

    bool load();
    bool setSharedMemory();

    struct DataSource {
        char user[64];
        char pass[64];
        char urn[64];
        char url[128];
        char port[8];
        char timeout[8];
        char type;
    };

    semi::posix::SharedMemory mDb;

    static std::string CONF_FILE_NAME;
    static std::string share_file_name;

    static DataSource getConfig(std::string tskid);

    static std::string toString();

private:
    std::string user;
    std::string pass;
    std::string urn;
    std::string url;
    std::string port;
    std::string timeout;
    char type;
};

}

}

#endif /* DATASOURCECONFIG_H_ */
